A browser application allows a user to retrieve and present information from resources on a network, such as the Internet or a private network, as well as from resources on a user computer. An information resource or a resource can be a file stored on a computer, for example, a document, an image file, a video file or any other media file. In a typical use case, a web server sends information to a browser application running on a client device in the form of documents written in a markup language, such as Hypertext Markup Language (HTML). A markup language document retrieved by a browser application can contain data and instructions that are executed on by the browser application. For example, a markup language document can include scripts for execution by a scripting engine supported by the browser application. An example of a scripting language supported by browser applications is JAVASCRIPT. A markup language document may also include instructions written in the markup language for rendering and drawing a user interface on the client device by the browser application.
To avoid intentional and unintentional harm caused by instructions in the markup language document, browser applications restrict the capabilities of the instructions that can be executed by a markup language document. For example, a markup language document is allowed to access only restricted portions of the file system of the client device. If the markup language document instructions were allowed unrestricted access to the file system of the client device, a malicious website could steal private information stored on client devices or even delete user files stored on client devices causing loss of data. The framework that restricts the capabilities of the browser application is referred to as a “sandbox.” Moreover, the capabilities of the instructions that can be included in a markup language document are limited as compared to processes written using general purpose programming languages, for example, C or C++. The performance obtained by implementing certain functionality using the scripting capabilities available in a markup language document can also be slow compared to an implementation using a general purpose programming language.